import { Component, PropsWithChildren } from 'react'
import { View, Text, Image } from '@tarojs/components'
import { AtList, AtListItem, AtIcon } from "taro-ui"
import './index.scss'
import Taro from '@tarojs/taro'

export default class Index extends Component<PropsWithChildren> {
  state: any
  constructor(props) {
    super(props)
    this.state = {
      
    }
  }
  componentWillMount() { }

  componentDidMount() { }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }
  onClick() {
    Taro.switchTab({
      url: '/pages/message/index'
    })
  }
  goRelease() {
    Taro.navigateTo({
      url: '/pages/MyRelease/index'
    })
  }
  goCollect() {
    Taro.navigateTo({
      url: '/pages/Collection/index'
    })
  }
  goHistory() {
    Taro.navigateTo({
      url: '/pages/History/index'
    })
  }
  goPayDetail() {
    Taro.navigateTo({
      url: '/pages/PayDetail/index'
    })
  }
  goFeedback() {
    Taro.navigateTo({
      url: '/pages/Feedback/index'
    })
  }
  goContact() {
    Taro.navigateTo({
      url: '/pages/Contact/index'
    })
  }
  render() {
    return (
      <View className='index'>
        <View className='nav-bar-box'>
          <View className='status-bar'></View>
          <View className='title-bar'>
            <Text className='tit'>我的</Text>
          </View>
        </View>
        <View className='mybox'>
          <View className='user'>
            <Image src='https://img1.baidu.com/it/u=2064254833,770634332&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500' />
            <View>
              <View className='name'>
                梦想^_^
                <AtIcon onClick={this.onClick.bind(this)} className='icon' value='message' size='24' color='#09f'></AtIcon>
              </View>
              <View>15217287384</View>
            </View>
          </View>
          <View className='icons'>
            <View className='tag' onClick={this.goRelease.bind(this)}>
              <AtIcon value='file-new' size='36' color='#0f9'></AtIcon>
              <View className='title'>我的发布</View>
            </View>
            <View className='tag' onClick={this.goCollect.bind(this)}>
              <AtIcon value='star-2' size='36' color='#f90'></AtIcon>
              <View className='title'>收藏</View>
            </View>
            <View className='tag' onClick={this.goHistory.bind(this)}>
              <AtIcon value='bullet-list' size='36' color='#f04'></AtIcon>
              <View className='title'>浏览历史</View>
            </View>
          </View>
        </View>
        <View className='mylist'>
          <AtList>
            <AtListItem
              title='支付明细'
              arrow='right'
              onClick={this.goPayDetail.bind(this)}
            />
            <AtListItem
              title='问题反馈'
              arrow='right'
              onClick={this.goFeedback.bind(this)}
            />
            <AtListItem
              title='联系客服'
              arrow='right'
              onClick={this.goContact.bind(this)}
            />
          </AtList>
        </View>
      </View>
    )
  }
}





// getData: [{
//   title: '支付明细',
//   icon: 'right'
// }, {
//   title: '问题反馈',
//   icon: 'right'
// }, {
//   title: '问题反馈',
//   icon: 'right'
// }]
